<template>
  <CocosScene >
    <Node ref="sprite" :nodeComps="comps" :nodeProps="{name:'cb',width:150,height:150,opacity:opacity,x:-200,y:-200}" />
    <Spine :spineProps="spineProps"/>
  </CocosScene >
</template>

<script>
/* eslint-disable */

import {CocosScene,Node,Spine} from "./cocos";

export default {
  name: "Scene2",
  components: {
    CocosScene,Node,Spine,
  },
  data() {
    return {
      comps:[],
      opacity:180,
      testFrame:null,
      spineProps:{},
    };
  },
  mounted() {
      cc.loader.load("./bear.png", (err, tex) => {
          var spriteComponent = {
            type: cc.Sprite,
            props: {
                spriteFrame: new cc.SpriteFrame(tex),
                sizeMode: cc.Sprite.SizeMode.CUSTOM,
            },
          };
          this.comps = [spriteComponent];
      });    
      // spineProps
  },
  methods: {
    startrot() {
      // setTimeout(()=>{
      //   if(this.$refs.sprite){
      //     let act = cc.rotateBy(5, 360);
      //     this.$refs.sprite.curNode.runAction(act.repeatForever());
      //     console.log("this.$refs.sprite",this.$refs.sprite.curNode);
      //   }else{
      //     this.startrot();
      //   }
      // },50);
    },
  },

};
</script>

